{extend name="base" /}
{block name="body"}
<style type="text/css" >
.layui-table th {
    padding: 9px 5px;
}
</style>
<div class="layui-body">
    <!--tab标签-->
    <div class="layui-tab layui-tab-brief">
        <ul class="layui-tab-title">
            <li class="layui-this">用户管理</li>
            <li class=""><a href="{:url('admin/user/add')}">添加用户</a></li>
        </ul>
        <div class="layui-tab-content">
            <div class="layui-tab-item layui-show">

                <form class="layui-form layui-form-pane" action="{:url('admin/user/index')}" method="get">
                    <div class="layui-inline">
                        <label class="layui-form-label">关键词</label>
                        <div class="layui-input-inline">
                            <input type="text" name="keyword" value="{$keyword}" placeholder="请输入关键词" class="layui-input">
                        </div>
                    </div>
                    <div class="layui-inline">
                        <button class="layui-btn">搜索</button>
                    </div>
                </form>
                <hr>

                <!-- 用户推荐 -->
                {eq name="parent_name" value=""}
                {else/}
                <table class="layui-table">
                    <tr>
                            <th colspan="15"><span style="color:#e90d24;">{$parent_name}</span>推荐的会员</th>
                    </tr>
                </table>
                {/eq}
                <!-- 用户推荐 -->

                <table class="layui-table">
                    {gt name="users.count" value="0"}
                    <thead>
                    <tr>
                        <th style="width: 30px;">ID<span style="color:#e90d24;">({$users.count})</span></th>
                        <th>用户名</th>
                        <th>手机</th>
                        <th>等级</th>
                        <th>商户余额<span style="color:#e90d24;">({$users.shop_money})</span></th>
                        <th>余额宝<span style="color:#e90d24;">({$users.balance})</span></th>
                        <th>激活积分<span style="color:#e90d24;">({$users.reg_integral})</span></th>
                        <th>释放激活积分<span style="color:#e90d24;">({$users.re_reg_integral})</span></th>
                        <th>消费积分<span style="color:#e90d24;">({$users.consume_integral})</span></th>
                        <th>释放消费积分<span style="color:#e90d24;">({$users.re_consume_integral})</span></th>
                        <th>推荐积分<span style="color:#e90d24;">({$users.share_integral})</span></th>
                        <th>释放推荐积分<span style="color:#e90d24;">({$users.re_share_integral})</span></th>
                        <!-- <th>邮箱</th> -->
                        <th>状态</th>
                        <th>创建时间</th>
                        <!--<th>最后登录时间</th>
                        <th>最后登录IP</th>-->
                        <th>操作</th>
                    </tr>
                    </thead>
                    {/gt}
                    <tbody>
                    {foreach name="user_list" item="vo"}
                    <tr>
                        <td>{$vo.id}</td>
                        <td>{$vo.user_name}</td>
                        <td>{$vo.mobile}</td>
                        <td>{$vo.rank_name}</td>
                        <td>{$vo.shop_money}</td>
                        <td>{$vo.balance}</td>
                        <td>{$vo.reg_integral}</td>
                        <td>{$vo.re_reg_integral}</td>
                        <td>{$vo.consume_integral}</td>
                        <td>{$vo.re_consume_integral}</td>
                        <td>{$vo.share_integral}</td>
                        <td>{$vo.re_share_integral}</td>
                        <!-- <td>{$vo.email}</td> -->
                        <td>{php}echo $vo['status']==1 ? '启用' : '禁用';{/php}</td>
                        <td>{$vo.create_time}</td>
                        <!--<td>{$vo.last_login_time}</td>
                        <td>{$vo.last_login_ip}</td>-->
                        <td>
                            <a href="{:url('admin/user/edit',['id'=>$vo['id']])}" class="layui-btn layui-btn-normal layui-btn-mini">编辑</a>
                            <a href="{:url('admin/user/delete',['id'=>$vo['id']])}" class="layui-btn layui-btn-danger layui-btn-mini ajax-delete">删除</a>
                            <a href="{:url('admin/user/index')}?pid={$vo.id}" class="layui-btn layui-btn-normal layui-btn-mini">推荐</a>
                        </td>
                    </tr>
                    {/foreach}
                    {eq name="users.count" value="0"}
                        <tr>
                            <td colspan="15">暂无数据!!</td>
                        </tr>
                    {/eq}
                    </tbody>
                </table>
                <!--分页-->
                {$user_list->render()}
            </div>
        </div>
    </div>
</div>
{/block}